package com.linshengjian.snowball.core;

import com.linshengjian.snowball.core.exception.DataHandlerException;

import java.util.Map;

public interface IDataHandler<T, ID> {
    T get(ID id) throws DataHandlerException;

    T save(T t, Map<Class, Object> map) throws DataHandlerException;

    void delete(T t, boolean logic) throws DataHandlerException;

    /**
     * 使用了 data 的数据
     * @param data 主数据
     * @return
     */
    Object getUseObject(Object data) throws DataHandlerException;

    /**
     * data 外联的数据
     * @param data 主数据
     * @return
     */
    T getOutreachObject(Object data) throws DataHandlerException;
}
